﻿using System;
using System.Collections.Generic;
using System.Text;

namespace LiteFrame
{
    public class User
    {
        string id;
        string logcode;
        string logpass;
        string nickname;
        string email;

        public User()
        { 
        }

        public User(string LogCode, string LogPass, string NickName, string Email)
        {
            this.id = Guid.NewGuid().ToString();
            this.logcode = LogCode.Trim();
            this.logpass = LogPass.Trim();
            this.nickname = NickName.Trim();
            this.email = Email.Trim();
        }
        public User(string ID, string NickName, string Email)
        {
            this.id = ID.Trim();
            this.logcode = null;
            this.logpass = null;
            this.nickname = NickName.Trim();
            this.email = Email.Trim();
        }
        public string ID
        {
            get { return this.id; }
            set { this.id = value; }
        }
        public string LogCode
        {
            get { return this.logcode; }
            set { this.logcode = value; }
        }
        public string LogPass
        {
            set { this.logpass = value; }
            get
            {
                return Security.GetMD5String(this.logpass);
            }
        }
        public string NickName
        {
            get { return this.nickname; }
            set { this.nickname = value; }
        }
        public string Email
        {
            get { return this.email; }
            set { this.email = value; }
        }
    }
}
